<template>
  <div>
    <van-nav-bar
      title="修改个人信息"
      right-text="保存"
      left-arrow
      @click-left="onClickLeft"
      @click-right="onClickRight"
    />
    <!-- 学科 -->
    <van-checkbox-group v-model="result">
      <van-cell-group>
        <van-cell 
          v-for="item in list"
          clickable
          :key="item"
          :title="`${item}`"
          @click="toggle(item)">
          <template #right-icon>
            <van-checkbox shape="square" :name="item" @click="change(item)" ref="checkboxes" />
          </template>
        </van-cell>
      </van-cell-group>
    </van-checkbox-group>
  </div>
</template>

<script>
export default {
  name: "",
  components: {},
  props: [],
  data() {
    return {
      checked: false,
      result: [],
      list: [
        "语文",
        "数学",
        "英语",
        "物理",
        "化学",
        "生物",
        "政治",
        "信息技术",
      ],
      arr:[],
    };
  },
  mounted() {},
  methods: {
    onClickRight() {
      console.log(this.arr)
      let arr=JSON.stringify(this.arr)
      console.log(arr)
          this.$router.push({path:'/personal',query:{list:arr}})
    },
    toggle(item) {
    },
    change(item){
      console.log(item)
      this.arr.push(item)
    },
    onClickLeft(){
        this.$router.push('/personal')
    }
  },
  computed: {},
  watch: {},
  created() {},
};
</script>

<style scoped>
</style>
